#ifndef  __QUEUE_H
#define  __QUEUE_H

//----------------------------------Include-------------------------------------
#include <stdint.h>
//------------------------------------------------------------------------------

//-----------------------------------Macro--------------------------------------
#define QUEUE_MAX                    8
//------------------------------------------------------------------------------

//-----------------------------------Types--------------------------------------
typedef struct{
  uint32_t       cap[QUEUE_MAX];
  uint32_t       tail;
  uint32_t       full;
}t_queue;
//------------------------------------------------------------------------------

//----------------------------------Declare-------------------------------------
void     queue_wr_one(t_queue* pq, uint32_t data);
void     queue_delete_all(t_queue* pq);
uint32_t queue_total(t_queue* pq);
void     queue_get_max(t_queue* pq, uint32_t* pmaxv, uint32_t* pidx, uint32_t* ptimes);
uint32_t queue_find_value(t_queue* pq, uint32_t v, uint32_t* pidx);
uint32_t queue_get_average(t_queue* pq);
//------------------------------------------------------------------------------
#endif
//------------------------------------EOF---------------------------------------



